package com.gjy.design.bridge.factory;

/**
 * @author gjy
 * @version 1.0
 * @since 2025-11-10 09:29:34
 */
public class PersistFactory {

    public static DataPersist getPersist(String type) {
        switch (type) {
            case "file":
                return new FilePersist("/tmp/out.txt");
            case "db":
                return new DbPersist("jdbc:sqlite:demo.db");
            default:
                throw new IllegalArgumentException("Unknown type " + type);
        }
    }

}
